package com.yuan.mapper;

import com.yuan.bean.Book;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface BookInformationMapper {

    //查询所有书籍
    List<Book> selectAll();

    //通过类别查找书籍
    List<Book> selectAllByCategory(String category);

    //动态模糊查询，判断前台填入了几个条件进行模糊查询
    List<Book> selectByCondition(String category,String bookName,String author);

    //通过书的id来查询相应的书本数据
    Book selectAllByBookId(Integer bookId);

    //通过修改图书数据
    int updateBookInfo(Book book);

    //添加书籍
    int insertBook(Book book);

    //删除书籍
    int delByBookId(Integer bookId);
}
